<template>
  <div>
    <div class="search">
      <van-icon class="input_icon" name="search" />
      <input
        type="text"
        placeholder="搜索"
        class="searchInput"
        v-model="searchtext"
      />
      <span @click="returnTap">取消</span>
    </div>
    <div class="title" v-if="searchtext == ''">按关键词搜索</div>
    <div v-if="searchtext != ''">
      <div class="msg">联系人</div>
      <div v-for="item of list">
        <div class="list">
          <div class="list_left" @click="open(2)">
            <img class="list_img" src="../../assets/images/logo.png" alt="" />
          </div>
          <div class="list_right">
            <div class="col1" @click="open(1)">
              <span class="col2">小明</span>
              <span class="col3">2020-08-21</span>
            </div>
            <div class="col1" @click="open(1)">
              <span class="col4" v-if="item.status == 1">电话:1510000000</span>
              <span class="col5" v-if="item.status == 1">提醒</span>
            </div>
            <div class="col1">
              <span class="col3">[图片]</span>
              <!-- <span class="col3"></span> -->
            </div>
          </div>
        </div>
        <div class="listTitle">
          <span v-if="xiashow==0">描述</span>
          <van-icon v-if="xiashow==1" name="arrow-down" @click="xiashow=0" />
          <van-icon v-if="xiashow==0" name="arrow-up"  @click="xiashow=1" />
        </div>
      </div>
      <div v-if="moreshow == 1" class="row" @click="moreshow = 0">
        <span>更多联系人</span>
        <van-icon name="arrow-down" />
      </div>
      <div v-if="moreshow == 0" class="row" @click="moreshow = 1">
        <span>收起</span>
        <van-icon name="arrow-up" />
      </div>
      <div class="msg">群聊</div>
      <div v-for="item of list" @click="open(0)">
        <div class="list">
          <div class="list_left">
            <img class="list_img" src="../../assets/images/logo.png" alt="" />
          </div>
          <div class="list_right">
            <div class="col1">
              <span class="col2">汽车售卖群</span>
              <span class="col3">2020-08-21</span>
            </div>

            <div class="col1">
              <!-- <span class="col3">[图片]</span> -->
              <!-- <span class="col3"></span> -->
            </div>
            <div class="col1">
              <span class="col4" v-if="item.status == 1">包含: 小马</span>
              <span class="col5" v-if="item.status == 1">提醒</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <van-overlay
      :show="coupshow"
      style="background: rgba(30, 30, 30, 0.2)"
      @click="coupshow = false"
    >
      <div class="wrapper" @click.stop v-show="isshow == 1">
        <div class="block">
          <div class="titleA">分别发送给：</div>
          <div class="wrapImg">
            <img class="wrapImg1" src="../../assets/images/logo.png" alt="" />
          </div>
          <div class="wrapimage">
            <img class="wrapimage1" src="../../assets/images/card.png" alt="" />
          </div>
          <div class="wrapinput">
            <input type="text" placeholder="给朋友留言" />
          </div>
          <div class="caozuo">
            <div @click="coupshow = false">取消</div>
            <div @click="coupshow = false" style="color: #7e89ab">发送</div>
          </div>
        </div>
      </div>
      <div class="wrapper" @click.stop v-show="isshow == 0">
        <div class="block">
          <div class="tupianreturn">
            <van-icon name="arrow-left" @click="coupshow = false" />
          </div>
          <div class="tupianrow">
            <img src="../../assets/images/logo.png" alt="" />
            <span>群聊</span>
          </div>
          <img class="card" src="../../assets/images/card.png" alt="" />
          <div class="cardtext">
            该二维码7天内(8月23日前）有效，重新进入将更新
          </div>
        </div>
      </div>
      <div class="wrapper" @click.stop v-show="isshow == 2">
        <div class="block" style="background: #eee">
          <div class="top">
            <van-icon name="arrow-left" @click="coupshow = false" />
            <span>小李</span>
            <van-icon name="arrow-left leftIcon" style="color: #fff" />
          </div>
          <div class="messageleft">
            <img
              class="messageleftimg1"
              src="../../assets/images/logo.png"
              alt=""
            />
            <img
              class="messageleftimg2"
              src="../../assets/images/card.png"
              alt=""
            />
          </div>
          <div class="messageright">
            <img
              class="messageleftimg1"
              src="../../assets/images/logo.png"
              alt=""
            />
            <img
              class="messageleftimg2"
              src="../../assets/images/card.png"
              alt=""
            />
          </div>
          <div class="messageright">
            <img
              class="messageleftimg1"
              src="../../assets/images/logo.png"
              alt=""
            />
            <div class="messageleftText">是的</div>
          </div>
        </div>
      </div>
    </van-overlay>
  </div>
</template>
<script>
export default {
  data() {
    return {
      searchtext: "",
      list: [
        { name: "[15条]丽丽: 明白", num: 10, status: 1 },

      ],
      coupshow: false,
      isshow: 0,
      moreshow: 1,
      xiashow:1
    };
  },
  methods: {
    returnTap() {
      this.$router.go(-1);
    },
    open(index) {
      console.log(22);
      this.coupshow = true;
      this.isshow = index;
    },
  },
};
</script>
<style scoped>
.all {
  background: #eeeeee;
}
.search {
  height: 50px;
  display: flex;
  align-items: center;
  position: relative;
  background: #eeeeee;
}
.search input {
  width: 76%;
  height: 30px;
  border: none;
  border-radius: 5px;
  margin-left: 3%;
  padding-left: 6%;
}
.search span {
  margin-left: 10px;
  color: #626d8e;
}
.title {
  margin-top: 30px;
  text-align: center;
  color: #b3b3b3;
  font-size: 12px;
}
.input_icon {
  position: absolute;
  top: 15px;
  left: 3%;
  font-size: 20px;
}
.msg {
  width: 97%;
  padding-left: 3%;
  background: #eeeeee;
  font-size: 15px;
  height: 40px;
  line-height: 40px;
}
.list {
  height: 90px;
  width: 100%;

  display: flex;
  align-items: center;
}
.list_left {
  width: 18%;
  margin-left: 3%;
  display: flex;
  flex-direction: column;
}
.list_img {
  width: 100%;
  height: 70px;
  border-radius: 10px;
}
.list_right {
  width: 74%;
}
.col1 {
  width: 100%;
  margin-left: 2%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
  font-size: 15px;
}
.col2 {
  font-weight: bold;
}
.col3 {
  font-size: 14px;
  color: #999999;
}
.col4,
.col5 {
  font-size: 14px;
  color: #000;
}
.listTitle {
  font-size: 15px;
  padding: 5px 0;
  text-align: center;

  width: 100%;
}
.row {
  height: 40px;
  font-size: 16px;
  width: 94%;
  margin-left: 3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.block {
  width: 80%;
  height: 400px;
  border-radius: 10px;
  background-color: #fff;
}
.titleA {
  height: 60px;
  line-height: 60px;
  font-size: 22px;
  margin-left: 3%;
}
.wrapImg {
  width: 94%;
  margin: 0 3%;
  padding-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #eeeeee;
}
.wrapImg1 {
  width: 40px;
  height: 40px;
  border-radius: 5px;
}
.wrapimage {
  width: 100%;
  height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.wrapimage1 {
  width: 150px;
}
.wrapinput {
  height: 40px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.wrapinput input {
  width: 80%;
  border-radius: 50px;
  height: 30px;
  background: #f2f2f2;
  border: none;
  padding: 10px;
}
.caozuo {
  width: 100%;
  height: 70px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.caozuo div {
  width: 50%;
  text-align: center;
  font-weight: blod;
  font-size: 20px;
}
.tupianreturn {
  height: 60px;
  padding-left: 3%;
  font-size: 22px;
  line-height: 60px;
}
.tupianrow {
  height: 50px;
  display: flex;
  align-items: center;
}
.tupianrow img {
  width: 50px;
  height: 50px;
  border-radius: 5px;
  margin-left: 20px;
}
.tupianrow span {
  margin-left: 10px;
  font-size: 20px;
  font-weight: bold;
}
.card {
  margin: 0 15%;
  width: 70%;
}
.cardtext {
  text-align: center;
  font-size: 12px;
  margin-top: 20px;
  color: #aeaeae;
}
.top {
  height: 60px;
  font-size: 22px;
  width: 94%;
  margin-left: 3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.leftIcon {
  color: #fff;
}
.messageleft {
  height: 100px;
  display: flex;
  width: 94%;
  margin-left: 3%;
  justify-content: right;
  flex-direction: row-reverse;
  margin-top: 10px;
}
.messageright {
  height: 100px;
  display: flex;
  width: 94%;
  margin-left: 3%;
  justify-content: right;
  margin-top: 10px;
}
.messageright .messageleftimg2 {
  margin-left: 10px;
}
.messageleftimg2 {
  width: 60px;
  height: 100px;
  border-radius: 5px;
  margin-right: 10px;
}
.messageleftimg1 {
  width: 50px;
  height: 50px;
  border-radius: 5px;
}
.messageleftText {
  height: 40px;
  background: #fff;
  text-align: center;
  line-height: 40px;
  border-radius: 5px;
  padding: 0 10px;
  margin-left: 10px;
}
</style>